home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
0411.ZIP
/
STRNGHEX.C
< prev
next >
Wrap
Text File
|
1985-07-22
|
584b
|
29 lines
/*
* Program to read the keyboard and return the hex and decimal equivalents.
*/
#include "stdio.h"
main()
{
int c,
incntr,
outcntr,
finished;
short instring[256];
finished = 0;
while (!finished)
{
puts("\nType in a string terminated by [Enter] to see its hex values\n");
incntr = 0;
while ((instring[incntr++] = getchar()) != 0xd);
printf("\n");
outcntr = 0;
if (!(finished = (incntr == 1)))
{
while (outcntr < (incntr-1))
printf("%x ",instring[outcntr++]);
printf("\n");
}
}
exit(0);
}